1. Field of the Invention
The present invention relates generally to computer graphics and more specifically to the manipulation of color filter arrays used to represent color images captured by a digital camera.
2. Description of Related Art
Digital cameras that capture color images are rapidly becoming popular. These digital cameras are used for still photography and full motion video recording. The images captured by the camera may be transferred to a computer system and displayed on a computer monitor for viewing by the user. The increasing power of microprocessors permits many sophisticated and computationally intensive image processing operations to be performed by software executing on the computer system rather than by special purpose circuitry in the camera. Image processing methods implemented in software allow presentation of higher quality images to the user while lowering the cost of the digital camera, because the specialized circuitry for performing various image processing operations is no longer needed.
Most commercial digital cameras use a single-chip color filter array to capture images. The color filter array is located in the focal plane of the camera in the same place that film is located in a traditional film camera. A single-chip color filter array is a two-dimensional grid of picture elements, called pixels, covered by color filters. Each pixel is typically implemented through the use of a charge-coupled device (CCD) or CMOS circuit. To minimize the cost of the color filter array (and therefore the cost of the camera), only one of the red, green or blue colors is sensed at each pixel. Hence, information for two colors of a red, green, and blue (RGB) color combination is missing at each pixel of the sensed image. The colors that are sensed are arranged in a predetermined pattern in the color filter array so that the entire image may be represented to the user in an aesthetically pleasing manner, despite the missing color information. One pattern that is useful for representing such images is disclosed in U.S. Pat. No. 3,971,065, issued to B. E. Bayer. There are also many other patterns that can be used to represent color images.
An example of a color filter array with a Bayer pattern is shown in FIG. 1. Pixels are represented by squares in the grid of FIG. 1. Each pixel includes an electronic sensor which measures the light falling on it. Those pixels which have a red filter measure red light and are represented by an R in the pattern, those pixels which have a green filter measure green light and are represented by a G in the pattern, and those pixels which have a blue filter measure blue light and are represented by a B in the pattern. The Bayer pattern is replicated throughout the entire color filter array in both the horizontal and vertical directions.
A problem with this method of capturing color images is that only a single color is sensed and stored at each pixel in the color filter array, although three colors (red, green and blue) are needed to reconstruct the true color at each pixel. Typically, each pixel is represented by eight bits for a color. Hence, the amount of color information being collected at each pixel in the captured image is only eight bits, but 24 bits are needed for the complete set of red, green and blue color values for the pixel. Cameras which use a single color filter array must determine the missing color values at each pixel. For example, values of missing red and blue colors must be found for a pixel with a green filter.
Existing systems use color values of adjacent pixels to interpolate the missing color values. The simplest approach is to treat each color plane separately. A color plane is the representation of a single color for the whole color filter array. With the separate color plane method, missing red, green, and blue values are determined by reference to neighboring red, green, and blue pixels, respectively.
Some methods for computing missing color values use color values from other color planes. In most cases, values from the green plane are combined with values of adjacent red pixels to determine missing red values, and values from the green plane are combined with values of adjacent blue pixels to determine missing blue values. Generally, color array patterns (such as the Bayer pattern) use more green pixels than red or blue pixels. Using more green pixels than red and blue pixels improves luminance resolution or sharpness of the image without significantly degrading color quality. A method disclosed by P. D. Dillon, D. M. Lew, and F. G. Kaspar in "Color Imaging System Using A Single CCD Array", IEEE Trans. Electron Devices, vol. ED-32, pp. 102-107, 1978, combines green with other colors, subtracts a purposely blurred green value from an original green value, and adds the difference to all three color planes. This method is an image sharpening technique also known as unsharp masking as discussed by R. C. Gonzalez and R. E. Woods in "Digital Image Processing", published by Addison-Wesley of Reading, Mass., 1992. Another method, taught by J. A. Weldy in "Optimized Design For A Single-Sensor Color Electron Camera System", Proceedings of SPIE, vol. 107, vol. 1071, pp. 300-308, 1989, linearly interpolates missing green values so that there are green values at all pixel locations, and then uses the difference between red and green at red pixel locations to interpolate missing red values, and the difference between blue and green at blue pixel locations to interpolate missing blue values.
These methods for interpolating missing color values suffer from two problems. Interpolation results in blurred images, and inaccurate interpolation of red and blue values tends to produce aliasing artifacts at object boundaries within the image. Object boundaries may appear as red or blue instead of their true colors. Most cameras reduce these aliasing artifacts by optically blurring the image before it reaches the sensor. This technique is discussed by J. E. Grievenkamp in "Color Dependent Optical Prefilter For The Suppression Of Aliasing", Applied Optics, vol. 29, pp. 676-684, February 1990. A new method is needed which overcomes these problems by forming a compromise between blurring and aliasing reduction methods to provide excellent quality, true color images in a cost-efficient manner.